package com.example.finance_oa.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.example.comment_oa.pojos.Standard;
import com.example.comment_oa.response.AjaxResponse;
import com.example.finance_oa.service.StandardService;
import com.example.finance_oa.mapper.StandardMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Jin
 * @description 针对表【standard】的数据库操作Service实现
 * @createDate 2022-10-12 19:01:52
 */
@Service
public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard>
        implements StandardService{
    @Autowired
    StandardMapper standardMapper;


    @Override
    public List<Standard> allStandard(Standard standard) {
        List<Standard> list=standardMapper.allStandar(standard);
        return list;
    }

    @Override
    public boolean saveStandard(Standard standard) {
        boolean a ;
        if(standard.getStandardId()!=null){
            a = standardMapper.updatestandar(standard);
        }else {
            a=standardMapper.insertAll(standard);
        }
        return a;
    }


}




